#####################Not included in the article################################
###################Simulations for posterior predictive p-values################
#################weak null + cps + studentized test statistcs###################


###############################load packages####################################
# if(!require(MCMCpack)) install.packages(MCMCpack)
# if(!require(parallel)) install.packages(parallel)
# if(!require(tidyverse)) install.packages(tidyverse)
# if(!require(Matching)) install.packages(Matching)
# if(!require(latex2exp)) install.packages(latex2exp)
library(MCMCpack)
library(parallel)
library(tidyverse)
library(Matching)
library(latex2exp)


#####Put the 5 files into a same folder and set it as the working directory#####
#setwd("~/PPPPP")


#######You can set the nNodes according to the number of cores of the CPU#######
#nNodes <- detectCores() - 2
nNodes <- 12

#################################set the parameter##############################
params$data <- 'bmi'
params$normalize <- T


ppp = list()
for (i in 1:3) {
  params$match.num <- i - 1
  dta <- dta_generator(params)
  params$N <- nrow(dta$xat)
  ppp[[i]] = para.cal(simu.test,3,NA,seed)
}

